package cn.tedu.egmybatis1.mapper;

import cn.tedu.egmybatis1.pojo.entity.Orders;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface OrdersMapper {
    @Insert("INSERT INTO orders(id,state,amount,created) VALUES (NULL, #{state},#{amount},#{created})")
    int insertOrders(Orders orders);

    @Delete("DELETE FROM orders WHERE id=#{id}")
    int deleteById(int id);

    @Update("UPDATE orders SET state=#{state},amount=#{amount},created=#{created} WHERE id=#{id}")
    int updateById(Orders orders);
}
